﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PF.MecSom {
    public partial class Principal : Form {
        Db.MecSom bancoDados;

        public Principal() {
            //bancoDados = new Db.MecSom("Data Source=Db\\MecSom.sdf;Persist Security Info=False;");
            bancoDados = new Db.MecSom();

            InitializeComponent();

            ucServicosPesquisa.Dock = DockStyle.Fill;
            ucServicosLista.Dock = DockStyle.Fill;

            ucServicosPesquisa.BancoDados = bancoDados;
            ucServicosLista.BancoDados = bancoDados;
        }

        private void frmPrincipal_Load(object sender, EventArgs e) {
            navbgOpcoes.Visible = false;
        }

        private void MostrarControle(UserControl controle) {
            ucServicosPesquisa.Hide();
            ucServicosLista.Hide();

            controle.Show();
        }

        private void navbiServicosPesquisa_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
            MostrarControle(ucServicosPesquisa);
        }
        private void navbiServicosLista_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
            MostrarControle(ucServicosLista);
            ucServicosLista.CarregarServicos();
        }

    }
}
